package Operations;
import Book.book;
import Book.bookList;
import java.util.Scanner;

//定义新增书籍操作这个类重写实现接口中的work抽象方法
public class AddOperation implements Ioperations{
    @Override
    public void work(bookList booklist) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入书名");
        String name=scanner.nextLine();
        System.out.println("请输入作者");
        String auther=scanner.nextLine();
        System.out.println("请输入价格");
        double price=scanner.nextDouble();
        System.out.println("请输入书籍的分类");
        String style=scanner.nextLine();
        book book=new book(name,auther,price,style);
        int pos=booklist.getUseMount();
        booklist.setBooks(pos,book);
        System.out.println("添加书籍成功");
    }
}
